package com.tencent.wxcloudrun.controller;

import javax.annotation.Resource;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tencent.wxcloudrun.config.ApiResponse;
import com.tencent.wxcloudrun.manager.SysManager;
import com.tencent.wxcloudrun.vo.request.sys.QuestionListReqVo;
import com.tencent.wxcloudrun.vo.request.sys.SysConfigListReqVo;
import com.tencent.wxcloudrun.vo.request.sys.SysFillListReqVo;
import com.tencent.wxcloudrun.vo.response.sys.QuestionListResVo;
import com.tencent.wxcloudrun.vo.response.sys.SysConfigListResVo;
import com.tencent.wxcloudrun.vo.response.sys.SysFillListResVo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author ZhaoZiYin
 * @Date 2025/2/20
 * @Description 系统控制器
 */
@Api(tags = "系统控制器")
@Slf4j
@RestController
@Validated
@RequestMapping("/api/sys")
public class SysController {

    @Resource
    private SysManager sysManager;

    @ApiOperation("查询系统预填信息")
    @PostMapping(value = "/sysFill/list")
    public ApiResponse<SysFillListResVo> listSysFill(@RequestBody @Valid SysFillListReqVo reqVo) {
        return ApiResponse.ok(sysManager.listSysFill(reqVo));
    }

    @ApiOperation("查询系统配置信息")
    @PostMapping(value = "/sysConfig/list")
    public ApiResponse<SysConfigListResVo> listSysConfig(@RequestBody @Valid SysConfigListReqVo reqVo) {
        return ApiResponse.ok(sysManager.listSysConfig(reqVo));
    }

    @ApiOperation("查询问题信息")
    @PostMapping(value = "/question/list")
    public ApiResponse<QuestionListResVo> listQuestion(@RequestBody @Valid QuestionListReqVo reqVo) {
        return ApiResponse.ok(sysManager.listQuestion(reqVo));
    }

}
